// 导入Vue 主文件
import Vue from 'vue';

// 3.0 将vue-router集成到项目中
import vueRouter from 'vue-router';

// 3.1 将 vueRouter 对象绑定到 Vue 对象上
Vue.use(vueRouter);

// 3.2 导入路由规则对应的组件对象
import vip from './components/vip.vue';
import homeweb from './components/home.vue';
import shopcar from './components/car.vue';
import search from './components/search.vue';
import newslist from './components/home/newslist.vue';
import newsinfo from './components/home/news/newsinfo.vue';
import photolist from './components/home/photolist.vue';
import musiclist from './components/home/musiclist.vue';
import callmelist from './components/home/callmelist.vue';
import videolist from './components/home/videolist.vue';
import feedbacklist from './components/home/feedbacklist.vue';



// 3.3 定义路由规则
let router = new vueRouter({
    linkActiveClass: 'mui-active', // 改变路由激活时的类名
    routes: [{ // path 表示需要监听的路径名，component 表示要转到的组件 redirect 表示修改的哈希值
        path: '/', // 路由重定向（如果是根路径就转到 /home 下）
        redirect: '/home'
    }, {
        path: '/home', // 首页
        component: homeweb
    }, {
        path: '/car', //购物车
        component: shopcar
    }, {
        path: '/vip', //会员
        component: vip
    }, {
        path: '/search', //搜索
        component: search
    }, {
        path: '/home/newslist', //新闻列表
        component: newslist
    }, {
        path: '/home/newsinfo/:docid', // 新闻详情列表
        component: newsinfo
    }, {
        path: '/home/photolist', //图片分享
        component: photolist
    }, {
        path: '/home/musiclist', //商品购买
        component: musiclist
    }, {
        path: '/home/callmelist', //联系我们
        component: callmelist
    }, {
        path: '/home/videolist', // 视频专区
        component: videolist
    }, {
        path: '/home/feedbacklist', //意见反馈
        component: feedbacklist
    }]
})



export default router